Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add infra_role_summary plan #225

Merged
merged 1 commit into from
Apr 15, 2024
Merged

Conversation

bastelfreak
Copy link
Contributor

This plan returns a hash of data with all PE infra nodes and their role.

Please check off the steps below as you complete each step

  • Put the Jira ticket or Github issue number in parentheses in the Title e.g. (SUP-XXXX) Add Super Duper State Check
  • Update the Jira ticket status to Ready for Review if there is one
  • Review any CI failures and fix issues

@bastelfreak bastelfreak requested a review from a team as a code owner April 11, 2024 13:35
@bastelfreak
Copy link
Contributor Author

example output:

# puppet plan run pe_status_check::infra_role_summary
Starting plan job ...
New Plan Job ID: 7

|
{
    "primary": [
        "primary.bastelfreak.local"
    ],
    "replica": [],
    "compiler": [
        "compiler.bastelfreak.local"
    ],
    "postgres": [],
    "legacy_primary": [],
    "legacy_compiler": []
}

@bastelfreak
Copy link
Contributor Author

@MartyEwings can I get your opinion on this? I would also like to add a switch so we return the hash by default, but could switch to a nice table. That will add https://github.com/voxpupuli/puppet-format as a dependency. PEADM does the same in https://github.com/puppetlabs/puppetlabs-peadm/blob/main/plans/status.pp

@MartyEwings
Copy link
Collaborator

@MartyEwings can I get your opinion on this? I would also like to add a switch so we return the hash by default, but could switch to a nice table. That will add https://github.com/voxpupuli/puppet-format as a dependency. PEADM does the same in https://github.com/puppetlabs/puppetlabs-peadm/blob/main/plans/status.pp

@bastelfreak its always good to have a second way of getting the data, crucially this will tell you want it should be, rather than what is, (assuming no one tinkered with the fact), what are you thinking the use case of this data is.

With regards adding dependencies for formatting, as this is shipped with PE i cant add 3rd party deps

@MartyEwings MartyEwings added the enhancement New feature or request label Apr 11, 2024
@bastelfreak
Copy link
Contributor Author

I'm working on a plan that writes a bolt config to use peadm::convert. I also could have queried the puppetdb for the pe_status_check_role fact, but that would have been the same effort and I think querying for classes is more secure.

Why cant we depend on other modules? PE alreadys ships a lot of modules.

@MartyEwings
Copy link
Collaborator

Why cant we depend on other modules? PE alreadys ships a lot of modules.

PE only ships Modules that are authored internally, and even then, i have to get a lot of agreement from product to add anything new. I cant see a formatting module by VOX being approved for packaging and shipping

@bastelfreak
Copy link
Contributor Author

meh :(
But I can reuse the data in a wrapper plan and format it, that's okay to work with.

@MartyEwings
Copy link
Collaborator

@bastelfreak ok, ill do a bit to due diligence on this, but i cant see a reason not to put it in, can you add a touch more about the source of the data in the docs, just so its clear "it gets x via y mechanism"

@bastelfreak
Copy link
Contributor Author

I added some notes and example output to the README.md.

Copy link
Contributor

@Aaronoftheages Aaronoftheages left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I tested it on my puppet environment and it behaved as described:

`[root@**************** puppetlabs]# puppet plan run pe_status_check::infra_role_summary
Starting plan job ...
New Plan Job ID: 1

|
{
"primary": [
"{-My primary Server-}"
],
"replica": [],
"compiler": [],
"postgres": [],
"legacy_primary": [],
"legacy_compiler": []
}`

This plan returns a hash of data with all PE infra nodes and their role.
@bastelfreak
Copy link
Contributor Author

I rebased this after #224 got merged.

@Aaronoftheages Aaronoftheages merged commit 793f801 into puppetlabs:main Apr 15, 2024
24 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants